{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "a8700dee",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "22/04/23 19:46:56 WARN Utils: Your hostname, huzujundeMacBook-Pro.local resolves to a loopback address: 127.0.0.1; using 192.168.3.6 instead (on interface en0)\n",
      "22/04/23 19:46:56 WARN Utils: Set SPARK_LOCAL_IP if you need to bind to another address\n",
      "Using Spark's default log4j profile: org/apache/spark/log4j-defaults.properties\n",
      "Setting default log level to \"WARN\".\n",
      "To adjust logging level use sc.setLogLevel(newLevel). For SparkR, use setLogLevel(newLevel).\n",
      "22/04/23 19:46:57 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable\n"
     ]
    },
    {
     "ename": "Py4JJavaError",
     "evalue": "An error occurred while calling None.org.apache.spark.api.java.JavaSparkContext.\n: java.lang.IllegalAccessError: class org.apache.spark.storage.StorageUtils$ (in unnamed module @0x539c53b5) cannot access class sun.nio.ch.DirectBuffer (in module java.base) because module java.base does not export sun.nio.ch to unnamed module @0x539c53b5\n\tat org.apache.spark.storage.StorageUtils$.<init>(StorageUtils.scala:213)\n\tat org.apache.spark.storage.StorageUtils$.<clinit>(StorageUtils.scala)\n\tat org.apache.spark.storage.BlockManagerMasterEndpoint.<init>(BlockManagerMasterEndpoint.scala:110)\n\tat org.apache.spark.SparkEnv$.$anonfun$create$9(SparkEnv.scala:348)\n\tat org.apache.spark.SparkEnv$.registerOrLookupEndpoint$1(SparkEnv.scala:287)\n\tat org.apache.spark.SparkEnv$.create(SparkEnv.scala:336)\n\tat org.apache.spark.SparkEnv$.createDriverEnv(SparkEnv.scala:191)\n\tat org.apache.spark.SparkContext.createSparkEnv(SparkContext.scala:277)\n\tat org.apache.spark.SparkContext.<init>(SparkContext.scala:460)\n\tat org.apache.spark.api.java.JavaSparkContext.<init>(JavaSparkContext.scala:58)\n\tat java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\n\tat java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)\n\tat java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\n\tat java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)\n\tat java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)\n\tat py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:247)\n\tat py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)\n\tat py4j.Gateway.invoke(Gateway.java:238)\n\tat py4j.commands.ConstructorCommand.invokeConstructor(ConstructorCommand.java:80)\n\tat py4j.commands.ConstructorCommand.execute(ConstructorCommand.java:69)\n\tat py4j.ClientServerConnection.waitForCommands(ClientServerConnection.java:182)\n\tat py4j.ClientServerConnection.run(ClientServerConnection.java:106)\n\tat java.base/java.lang.Thread.run(Thread.java:833)\n",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mPy4JJavaError\u001b[0m                             Traceback (most recent call last)",
      "\u001b[0;32m/var/folders/n4/g1xtbtsn5gz6k5yv4ss93hfc0000gn/T/ipykernel_60839/1340208823.py\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m      5\u001b[0m \u001b[0mr0\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mredis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mRedis\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mhost\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'localhost'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mport\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m6379\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdb\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdecode_responses\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      6\u001b[0m \u001b[0mr1\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mredis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mRedis\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mhost\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'localhost'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mport\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m6379\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdb\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdecode_responses\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 7\u001b[0;31m \u001b[0;32mimport\u001b[0m \u001b[0mcore\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m      8\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mcantonese_core\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      9\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m~/Desktop/cuhk/project/cse_project/core.py\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m     14\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0msklearn\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmetrics\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpairwise\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mcosine_similarity\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     15\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 16\u001b[0;31m \u001b[0mspark\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mSparkSession\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbuilder\u001b[0m\u001b[0;31m \u001b[0m\u001b[0;31m\\\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m     17\u001b[0m     \u001b[0;34m.\u001b[0m\u001b[0mappName\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"rhyme\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;31m \u001b[0m\u001b[0;31m\\\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     18\u001b[0m     \u001b[0;34m.\u001b[0m\u001b[0mgetOrCreate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/usr/local/anaconda3/envs/python39/lib/python3.8/site-packages/pyspark/sql/session.py\u001b[0m in \u001b[0;36mgetOrCreate\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m    226\u001b[0m                             \u001b[0msparkConf\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mset\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvalue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    227\u001b[0m                         \u001b[0;31m# This SparkContext may be an existing one.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 228\u001b[0;31m                         \u001b[0msc\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mSparkContext\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgetOrCreate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msparkConf\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    229\u001b[0m                     \u001b[0;31m# Do not update `SparkConf` for existing `SparkContext`, as it's shared\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    230\u001b[0m                     \u001b[0;31m# by all sessions.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/usr/local/anaconda3/envs/python39/lib/python3.8/site-packages/pyspark/context.py\u001b[0m in \u001b[0;36mgetOrCreate\u001b[0;34m(cls, conf)\u001b[0m\n\u001b[1;32m    390\u001b[0m         \u001b[0;32mwith\u001b[0m \u001b[0mSparkContext\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_lock\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    391\u001b[0m             \u001b[0;32mif\u001b[0m \u001b[0mSparkContext\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_active_spark_context\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 392\u001b[0;31m                 \u001b[0mSparkContext\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mconf\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mconf\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0mSparkConf\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    393\u001b[0m             \u001b[0;32mreturn\u001b[0m \u001b[0mSparkContext\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_active_spark_context\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    394\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/usr/local/anaconda3/envs/python39/lib/python3.8/site-packages/pyspark/context.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, master, appName, sparkHome, pyFiles, environment, batchSize, serializer, conf, gateway, jsc, profiler_cls)\u001b[0m\n\u001b[1;32m    144\u001b[0m         \u001b[0mSparkContext\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_ensure_initialized\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgateway\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mgateway\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconf\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mconf\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    145\u001b[0m         \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 146\u001b[0;31m             self._do_init(master, appName, sparkHome, pyFiles, environment, batchSize, serializer,\n\u001b[0m\u001b[1;32m    147\u001b[0m                           conf, jsc, profiler_cls)\n\u001b[1;32m    148\u001b[0m         \u001b[0;32mexcept\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/usr/local/anaconda3/envs/python39/lib/python3.8/site-packages/pyspark/context.py\u001b[0m in \u001b[0;36m_do_init\u001b[0;34m(self, master, appName, sparkHome, pyFiles, environment, batchSize, serializer, conf, jsc, profiler_cls)\u001b[0m\n\u001b[1;32m    207\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    208\u001b[0m         \u001b[0;31m# Create the Java SparkContext through Py4J\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 209\u001b[0;31m         \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_jsc\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mjsc\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_initialize_context\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_conf\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_jconf\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    210\u001b[0m         \u001b[0;31m# Reset the SparkConf to the one actually used by the SparkContext in JVM.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    211\u001b[0m         \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_conf\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mSparkConf\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0m_jconf\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_jsc\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mconf\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/usr/local/anaconda3/envs/python39/lib/python3.8/site-packages/pyspark/context.py\u001b[0m in \u001b[0;36m_initialize_context\u001b[0;34m(self, jconf)\u001b[0m\n\u001b[1;32m    327\u001b[0m         \u001b[0mInitialize\u001b[0m \u001b[0mSparkContext\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mfunction\u001b[0m \u001b[0mto\u001b[0m \u001b[0mallow\u001b[0m \u001b[0msubclass\u001b[0m \u001b[0mspecific\u001b[0m \u001b[0minitialization\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    328\u001b[0m         \"\"\"\n\u001b[0;32m--> 329\u001b[0;31m         \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_jvm\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mJavaSparkContext\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mjconf\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    330\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    331\u001b[0m     \u001b[0;34m@\u001b[0m\u001b[0mclassmethod\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/usr/local/anaconda3/envs/python39/lib/python3.8/site-packages/py4j/java_gateway.py\u001b[0m in \u001b[0;36m__call__\u001b[0;34m(self, *args)\u001b[0m\n\u001b[1;32m   1583\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1584\u001b[0m         \u001b[0manswer\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_gateway_client\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msend_command\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcommand\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1585\u001b[0;31m         return_value = get_return_value(\n\u001b[0m\u001b[1;32m   1586\u001b[0m             answer, self._gateway_client, None, self._fqn)\n\u001b[1;32m   1587\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/usr/local/anaconda3/envs/python39/lib/python3.8/site-packages/py4j/protocol.py\u001b[0m in \u001b[0;36mget_return_value\u001b[0;34m(answer, gateway_client, target_id, name)\u001b[0m\n\u001b[1;32m    324\u001b[0m             \u001b[0mvalue\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mOUTPUT_CONVERTER\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mtype\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0manswer\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgateway_client\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    325\u001b[0m             \u001b[0;32mif\u001b[0m \u001b[0manswer\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0mREFERENCE_TYPE\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 326\u001b[0;31m                 raise Py4JJavaError(\n\u001b[0m\u001b[1;32m    327\u001b[0m                     \u001b[0;34m\"An error occurred while calling {0}{1}{2}.\\n\"\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    328\u001b[0m                     format(target_id, \".\", name), value)\n",
      "\u001b[0;31mPy4JJavaError\u001b[0m: An error occurred while calling None.org.apache.spark.api.java.JavaSparkContext.\n: java.lang.IllegalAccessError: class org.apache.spark.storage.StorageUtils$ (in unnamed module @0x539c53b5) cannot access class sun.nio.ch.DirectBuffer (in module java.base) because module java.base does not export sun.nio.ch to unnamed module @0x539c53b5\n\tat org.apache.spark.storage.StorageUtils$.<init>(StorageUtils.scala:213)\n\tat org.apache.spark.storage.StorageUtils$.<clinit>(StorageUtils.scala)\n\tat org.apache.spark.storage.BlockManagerMasterEndpoint.<init>(BlockManagerMasterEndpoint.scala:110)\n\tat org.apache.spark.SparkEnv$.$anonfun$create$9(SparkEnv.scala:348)\n\tat org.apache.spark.SparkEnv$.registerOrLookupEndpoint$1(SparkEnv.scala:287)\n\tat org.apache.spark.SparkEnv$.create(SparkEnv.scala:336)\n\tat org.apache.spark.SparkEnv$.createDriverEnv(SparkEnv.scala:191)\n\tat org.apache.spark.SparkContext.createSparkEnv(SparkContext.scala:277)\n\tat org.apache.spark.SparkContext.<init>(SparkContext.scala:460)\n\tat org.apache.spark.api.java.JavaSparkContext.<init>(JavaSparkContext.scala:58)\n\tat java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\n\tat java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)\n\tat java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\n\tat java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)\n\tat java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)\n\tat py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:247)\n\tat py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)\n\tat py4j.Gateway.invoke(Gateway.java:238)\n\tat py4j.commands.ConstructorCommand.invokeConstructor(ConstructorCommand.java:80)\n\tat py4j.commands.ConstructorCommand.execute(ConstructorCommand.java:69)\n\tat py4j.ClientServerConnection.waitForCommands(ClientServerConnection.java:182)\n\tat py4j.ClientServerConnection.run(ClientServerConnection.java:106)\n\tat java.base/java.lang.Thread.run(Thread.java:833)\n"
     ]
    }
   ],
   "source": [
    "import redis\n",
    "%load_ext autoreload\n",
    "%reload_ext autoreload\n",
    "%autoreload 2\n",
    "r0 = redis.Redis(host='localhost', port=6379, db=0, decode_responses=True)\n",
    "r1 = redis.Redis(host='localhost', port=6379, db=1, decode_responses=True)\n",
    "import core\n",
    "import cantonese_core\n",
    "\n",
    "def with_tone_cantonese(word: str):\n",
    "    return cantonese_core.find_rhyme_with_tone(word).collect()\n",
    "\n",
    "def without_tone_cantonese(word: str):\n",
    "    return cantonese_core.find_rhyme_without_tone(word).collect()\n",
    "\n",
    "def with_tone(word: str):\n",
    "    return core.find_rhyme_with_tone(word).collect()\n",
    "\n",
    "def without_tone(word: str):\n",
    "    return core.find_rhyme_without_tone(word).collect()\n",
    "\n",
    "def find_in_redis(word, tone = False, cantonese = False):\n",
    "    if cantonese == False:\n",
    "        if tone:\n",
    "            word_pinyin = str(core.word_parser(word)[1])[1:-1]\n",
    "            print(word_pinyin)\n",
    "            result = r0.get(word_pinyin)\n",
    "            if result == None:\n",
    "                result = with_tone(word)\n",
    "                result = \",\".join([str(i.asDict()) for i in result])\n",
    "                r0.set(word_pinyin, result)\n",
    "        else:\n",
    "            word_pinyin = str(core.word_parser(word)[0])[1:-1]\n",
    "            print(word_pinyin)\n",
    "            result = r0.get(word_pinyin)\n",
    "            if result == None:\n",
    "                result = without_tone(word)\n",
    "                result = \",\".join([str(i.asDict()) for i in result])\n",
    "                r0.set(word_pinyin, result)\n",
    "    else:\n",
    "        if tone:\n",
    "            word_pinyin = str(cantonese_core.word_parser(word)[1])[1:-1]\n",
    "            print(word_pinyin)\n",
    "            result = r1.get(word_pinyin)\n",
    "            if result == None:\n",
    "                result = with_tone_cantonese(word)\n",
    "                result = \",\".join([str(i.asDict()) for i in result])\n",
    "                r1.set(word_pinyin, result)\n",
    "        else:\n",
    "            word_pinyin = str(cantonese_core.word_parser(word)[0])[1:-1]\n",
    "            print(word_pinyin)\n",
    "            result = r1.get(word_pinyin)\n",
    "            if result == None:\n",
    "                result = without_tone_cantonese(word)\n",
    "                result = \",\".join([str(i.asDict()) for i in result])\n",
    "                r1.set(word_pinyin, result)\n",
    "    return result\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "992b1912",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "'ei5', 'ou2'\n",
      "CPU times: user 798 µs, sys: 648 µs, total: 1.45 ms\n",
      "Wall time: 1.05 ms\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "\"{'rhyme': '你好', 'count': 281},{'rhyme': '美好', 'count': 281},{'rhyme': '你早', 'count': 58},{'rhyme': '你到', 'count': 43},{'rhyme': '里早', 'count': 13},{'rhyme': '你保', 'count': 9},{'rhyme': '被讨', 'count': 9},{'rhyme': '里好', 'count': 6},{'rhyme': '美到', 'count': 5},{'rhyme': '里谱', 'count': 3},{'rhyme': '企到', 'count': 3},{'rhyme': '你讨', 'count': 3},{'rhyme': '你宝', 'count': 2},{'rhyme': '你补', 'count': 2},{'rhyme': '里到', 'count': 2},{'rhyme': '里土', 'count': 2},{'rhyme': '你堡', 'count': 2},{'rhyme': '企好', 'count': 2},{'rhyme': '美堡', 'count': 2},{'rhyme': '理好', 'count': 2},{'rhyme': '被好', 'count': 2},{'rhyme': '你祖', 'count': 2},{'rhyme': '你组', 'count': 1},{'rhyme': '你谱', 'count': 1},{'rhyme': '你捣', 'count': 1},{'rhyme': '被保', 'count': 1},{'rhyme': '里保', 'count': 1},{'rhyme': '尾好', 'count': 1},{'rhyme': '你祷', 'count': 1},{'rhyme': '你数', 'count': 1},{'rhyme': '您普', 'count': 1},{'rhyme': '您好', 'count': 1},{'rhyme': '里补', 'count': 1},{'rhyme': '里倒', 'count': 1},{'rhyme': '被倒', 'count': 1},{'rhyme': '里草', 'count': 1},{'rhyme': '你倒', 'count': 1}\""
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%time result = find_in_redis(\"你好\", tone = True, cantonese = False)\n",
    "result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "30259928",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CPU times: user 6.64 ms, sys: 12.6 ms, total: 19.3 ms\n",
      "Wall time: 961 ms\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "[Row(rhyme='十八', count=33), Row(rhyme='及发', count=1), Row(rhyme='十刹', count=1)]"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%time result = with_tone_cantonese(\"十八\")\n",
    "result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "bc8ff123",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[Row(rhyme='钟意', count=51), Row(rhyme='中意', count=17), Row(rhyme='冲刺', count=10), Row(rhyme='中刺', count=6), Row(rhyme='冬至', count=5), Row(rhyme='空置', count=4), Row(rhyme='中志', count=3), Row(rhyme='风刺', count=2), Row(rhyme='空至', count=2), Row(rhyme='中挚', count=2), Row(rhyme='风意', count=2), Row(rhyme='风肆', count=1), Row(rhyme='终次', count=1), Row(rhyme='终至', count=1), Row(rhyme='公至', count=1), Row(rhyme='通试', count=1), Row(rhyme='中至', count=1), Row(rhyme='众至', count=1), Row(rhyme='终志', count=1)]\n",
      "CPU times: user 6.39 ms, sys: 2.73 ms, total: 9.12 ms\n",
      "Wall time: 205 ms\n",
      "[Row(rhyme='纵使', count=217), Row(rhyme='从此', count=188), Row(rhyme='容易', count=160), Row(rhyme='同时', count=112), Row(rhyme='总是', count=101), Row(rhyme='纵是', count=96), Row(rhyme='终止', count=94), Row(rhyme='中只', count=72), Row(rhyme='讽刺', count=68), Row(rhyme='钟意', count=50), Row(rhyme='梦儿', count=42), Row(rhyme='梦已', count=38), Row(rhyme='终只', count=29), Row(rhyme='总之', count=22), Row(rhyme='梦似', count=20), Row(rhyme='公司', count=19), Row(rhyme='用自', count=19), Row(rhyme='同意', count=18), Row(rhyme='中已', count=17), Row(rhyme='终此', count=16), Row(rhyme='痛是', count=16), Row(rhyme='疯子', count=16), Row(rhyme='同是', count=15), Row(rhyme='风衣', count=15), Row(rhyme='中痴', count=14), Row(rhyme='终是', count=14), Row(rhyme='通知', count=14), Row(rhyme='童稚', count=13), Row(rhyme='懂自', count=13), Row(rhyme='种子', count=13), Row(rhyme='中意', count=13), Row(rhyme='种意', count=12), Row(rhyme='空只', count=12), Row(rhyme='重视', count=12), Row(rhyme='中是', count=12), Row(rhyme='公子', count=12), Row(rhyme='风之', count=12), Row(rhyme='中似', count=12), Row(rhyme='空之', count=12), Row(rhyme='梦是', count=12), Row(rhyme='同事', count=11), Row(rhyme='从自', count=11), Row(rhyme='宠儿', count=10), Row(rhyme='冲刺', count=10), Row(rhyme='中依', count=10), Row(rhyme='懂事', count=10), Row(rhyme='风已', count=10), Row(rhyme='动时', count=9), Row(rhyme='宗旨', count=9), Row(rhyme='风似', count=9), Row(rhyme='用时', count=8), Row(rhyme='用意', count=8), Row(rhyme='拥之', count=8), Row(rhyme='涌而', count=8), Row(rhyme='痛只', count=7), Row(rhyme='种姿', count=7), Row(rhyme='涌至', count=7), Row(rhyme='中止', count=7), Row(rhyme='同自', count=7), Row(rhyme='痛之', count=7), Row(rhyme='中始', count=6), Row(rhyme='通只', count=6), Row(rhyme='中思', count=6), Row(rhyme='从而', count=6), Row(rhyme='东已', count=6), Row(rhyme='风知', count=6), Row(rhyme='钟已', count=6), Row(rhyme='风姿', count=6), Row(rhyme='勇士', count=6), Row(rhyme='从之', count=6), Row(rhyme='中刺', count=6), Row(rhyme='纵已', count=6), Row(rhyme='拢是', count=6), Row(rhyme='种痴', count=6), Row(rhyme='种刺', count=6), Row(rhyme='勇字', count=5), Row(rhyme='红是', count=5), Row(rhyme='动只', count=5), Row(rhyme='中自', count=5), Row(rhyme='空是', count=5), Row(rhyme='动似', count=5), Row(rhyme='公义', count=5), Row(rhyme='用词', count=5), Row(rhyme='冬至', count=5), Row(rhyme='梦而', count=5), Row(rhyme='拥时', count=5), Row(rhyme='动是', count=5), Row(rhyme='动自', count=5), Row(rhyme='动已', count=5), Row(rhyme='重意', count=5), Row(rhyme='用字', count=4), Row(rhyme='容时', count=4), Row(rhyme='种籽', count=4), Row(rhyme='空似', count=4), Row(rhyme='纵自', count=4), Row(rhyme='懂知', count=4), Row(rhyme='中指', count=4), Row(rhyme='中试', count=4), Row(rhyme='冬衣', count=4), Row(rhyme='风撕', count=4), Row(rhyme='中厮', count=4), Row(rhyme='统治', count=4), Row(rhyme='涌是', count=4), Row(rhyme='踪只', count=4), Row(rhyme='丰姿', count=4), Row(rhyme='种自', count=4), Row(rhyme='空置', count=4), Row(rhyme='风依', count=4), Row(rhyme='重是', count=3), Row(rhyme='种试', count=3), Row(rhyme='碰之', count=3), Row(rhyme='红事', count=3), Row(rhyme='空已', count=3), Row(rhyme='用事', count=3), Row(rhyme='碰只', count=3), Row(rhyme='痛滋', count=3), Row(rhyme='踪知', count=3), Row(rhyme='用施', count=3), Row(rhyme='筒之', count=3), Row(rhyme='用只', count=3), Row(rhyme='奉自', count=3), Row(rhyme='控自', count=3), Row(rhyme='从时', count=3), Row(rhyme='风儿', count=3), Row(rhyme='中私', count=3), Row(rhyme='重自', count=3), Row(rhyme='痛事', count=3), Row(rhyme='终知', count=3), Row(rhyme='松弛', count=3), Row(rhyme='总似', count=3), Row(rhyme='共意', count=3), Row(rhyme='宫之', count=3), Row(rhyme='风是', count=3), Row(rhyme='公事', count=3), Row(rhyme='宠止', count=3), Row(rhyme='逢时', count=3), Row(rhyme='工资', count=3), Row(rhyme='种知', count=3), Row(rhyme='中志', count=3), Row(rhyme='痛移', count=3), Row(rhyme='梦依', count=3), Row(rhyme='重已', count=3), Row(rhyme='空自', count=3), Row(rhyme='钟迟', count=3), Row(rhyme='中知', count=3), Row(rhyme='动移', count=2), Row(rhyme='风刺', count=2), Row(rhyme='容只', count=2), Row(rhyme='中事', count=2), Row(rhyme='通而', count=2), Row(rhyme='用之', count=2), Row(rhyme='工之', count=2), Row(rhyme='终始', count=2), Row(rhyme='梦只', count=2), Row(rhyme='中时', count=2), Row(rhyme='从异', count=2), Row(rhyme='用以', count=2), Row(rhyme='匆只', count=2), Row(rhyme='拥是', count=2), Row(rhyme='梦之', count=2), Row(rhyme='钟似', count=2), Row(rhyme='统试', count=2), Row(rhyme='雄之', count=2), Row(rhyme='忠义', count=2), Row(rhyme='中诗', count=2), Row(rhyme='红姿', count=2), Row(rhyme='用指', count=2), Row(rhyme='封似', count=2), Row(rhyme='涌此', count=2), Row(rhyme='动视', count=2), Row(rhyme='逢自', count=2), Row(rhyme='拢知', count=2), Row(rhyme='重史', count=2), Row(rhyme='风治', count=2), Row(rhyme='碰而', count=2), Row(rhyme='用疑', count=2), Row(rhyme='钟时', count=2), Row(rhyme='冻至', count=2), Row(rhyme='蒙是', count=2), Row(rhyme='众只', count=2), Row(rhyme='送枝', count=2), Row(rhyme='空至', count=2), Row(rhyme='风而', count=2), Row(rhyme='共时', count=2), Row(rhyme='宠事', count=2), Row(rhyme='动词', count=2), Row(rhyme='中丝', count=2), Row(rhyme='梦时', count=2), Row(rhyme='梦始', count=2), Row(rhyme='红衣', count=2), Row(rhyme='封已', count=2), Row(rhyme='痛至', count=2), Row(rhyme='中挚', count=2), Row(rhyme='从示', count=2), Row(rhyme='逢之', count=2), Row(rhyme='童子', count=2), Row(rhyme='纵示', count=2), Row(rhyme='锋似', count=2), Row(rhyme='种是', count=2), Row(rhyme='冻只', count=2), Row(rhyme='同知', count=2), Row(rhyme='风意', count=2), Row(rhyme='重痴', count=2), Row(rhyme='共此', count=2), Row(rhyme='红只', count=2), Row(rhyme='容是', count=2), Row(rhyme='功只', count=2), Row(rhyme='中滋', count=2), Row(rhyme='忠旨', count=2), Row(rhyme='胧疑', count=2), Row(rhyme='终思', count=2), Row(rhyme='冬思', count=2), Row(rhyme='众议', count=2), Row(rhyme='雄视', count=2), Row(rhyme='松自', count=2), Row(rhyme='庸时', count=2), Row(rhyme='冻是', count=2), Row(rhyme='用耳', count=2), Row(rhyme='总以', count=2), Row(rhyme='绒衣', count=1), Row(rhyme='用纸', count=1), Row(rhyme='种滋', count=1), Row(rhyme='种已', count=1), Row(rhyme='送儿', count=1), Row(rhyme='种事', count=1), Row(rhyme='重似', count=1), Row(rhyme='逢是', count=1), Row(rhyme='用诗', count=1), Row(rhyme='中巳', count=1), Row(rhyme='穷时', count=1), Row(rhyme='浓意', count=1), Row(rhyme='宗师', count=1), Row(rhyme='种衣', count=1), Row(rhyme='纵知', count=1), Row(rhyme='匆已', count=1), Row(rhyme='纵恣', count=1), Row(rhyme='钟之', count=1), Row(rhyme='恐只', count=1), Row(rhyme='中支', count=1), Row(rhyme='共知', count=1), Row(rhyme='动啲', count=1), Row(rhyme='终已', count=1), Row(rhyme='用知', count=1), Row(rhyme='终痴', count=1), Row(rhyme='公之', count=1), Row(rhyme='种只', count=1), Row(rhyme='碰事', count=1), Row(rhyme='动思', count=1), Row(rhyme='雄痴', count=1), Row(rhyme='胧是', count=1), Row(rhyme='松二', count=1), Row(rhyme='弄辞', count=1), Row(rhyme='痛似', count=1), Row(rhyme='风肆', count=1), Row(rhyme='懂只', count=1), Row(rhyme='容以', count=1), Row(rhyme='容始', count=1), Row(rhyme='宠是', count=1), Row(rhyme='风时', count=1), Row(rhyme='攻自', count=1), Row(rhyme='终次', count=1), Row(rhyme='锋撕', count=1), Row(rhyme='梦绮', count=1), Row(rhyme='种挚', count=1), Row(rhyme='终至', count=1), Row(rhyme='勇史', count=1), Row(rhyme='龙倚', count=1), Row(rhyme='总司', count=1), Row(rhyme='公始', count=1), Row(rhyme='种支', count=1), Row(rhyme='凤之', count=1), Row(rhyme='送思', count=1), Row(rhyme='虫儿', count=1), Row(rhyme='公至', count=1), Row(rhyme='冬之', count=1), Row(rhyme='送知', count=1), Row(rhyme='充绮', count=1), Row(rhyme='逢時', count=1), Row(rhyme='通已', count=1), Row(rhyme='东狮', count=1), Row(rhyme='融之', count=1), Row(rhyme='从是', count=1), Row(rhyme='雄雌', count=1), Row(rhyme='栋之', count=1), Row(rhyme='钟以', count=1), Row(rhyme='东二', count=1), Row(rhyme='红似', count=1), Row(rhyme='种字', count=1), Row(rhyme='从衣', count=1), Row(rhyme='龙之', count=1), Row(rhyme='通试', count=1), Row(rhyme='送只', count=1), Row(rhyme='风此', count=1), Row(rhyme='工以', count=1), Row(rhyme='疯事', count=1), Row(rhyme='衷而', count=1), Row(rhyme='终依', count=1), Row(rhyme='从指', count=1), Row(rhyme='从只', count=1), Row(rhyme='种时', count=1), Row(rhyme='拥至', count=1), Row(rhyme='懂思', count=1), Row(rhyme='拥滋', count=1), Row(rhyme='红字', count=1), Row(rhyme='空痴', count=1), Row(rhyme='仲以', count=1), Row(rhyme='痛时', count=1), Row(rhyme='充耳', count=1), Row(rhyme='动事', count=1), Row(rhyme='同思', count=1), Row(rhyme='容辞', count=1), Row(rhyme='共自', count=1), Row(rhyme='用依', count=1), Row(rhyme='风驰', count=1), Row(rhyme='控只', count=1), Row(rhyme='懂止', count=1), Row(rhyme='动知', count=1), Row(rhyme='总易', count=1), Row(rhyme='公哩', count=1), Row(rhyme='重置', count=1), Row(rhyme='翁依', count=1), Row(rhyme='胧之', count=1), Row(rhyme='同智', count=1), Row(rhyme='雄事', count=1), Row(rhyme='梦此', count=1), Row(rhyme='种指', count=1), Row(rhyme='讽已', count=1), Row(rhyme='忪依', count=1), Row(rhyme='钟始', count=1), Row(rhyme='工衣', count=1), Row(rhyme='用智', count=1), Row(rhyme='中史', count=1), Row(rhyme='同倚', count=1), Row(rhyme='控已', count=1), Row(rhyme='共至', count=1), Row(rhyme='逢已', count=1), Row(rhyme='碰已', count=1), Row(rhyme='用已', count=1), Row(rhyme='宠似', count=1), Row(rhyme='螽斯', count=1), Row(rhyme='痛迟', count=1), Row(rhyme='中此', count=1), Row(rhyme='从施', count=1), Row(rhyme='共义', count=1), Row(rhyme='虹之', count=1), Row(rhyme='钟自', count=1), Row(rhyme='宫此', count=1), Row(rhyme='封豕', count=1), Row(rhyme='众已', count=1), Row(rhyme='弄试', count=1), Row(rhyme='动之', count=1), Row(rhyme='总医', count=1), Row(rhyme='忪自', count=1), Row(rhyme='统撕', count=1), Row(rhyme='缝意', count=1), Row(rhyme='种二', count=1), Row(rhyme='翁是', count=1), Row(rhyme='送是', count=1), Row(rhyme='碰指', count=1), Row(rhyme='梦滋', count=1), Row(rhyme='梦炽', count=1), Row(rhyme='从知', count=1), Row(rhyme='统已', count=1), Row(rhyme='红而', count=1), Row(rhyme='冬时', count=1), Row(rhyme='痛而', count=1), Row(rhyme='从撕', count=1), Row(rhyme='穷已', count=1), Row(rhyme='涌视', count=1), Row(rhyme='统只', count=1), Row(rhyme='从思', count=1), Row(rhyme='中之', count=1), Row(rhyme='松是', count=1), Row(rhyme='从始', count=1), Row(rhyme='中至', count=1), Row(rhyme='凶时', count=1), Row(rhyme='众至', count=1), Row(rhyme='纵此', count=1), Row(rhyme='终志', count=1), Row(rhyme='浓时', count=1), Row(rhyme='终自', count=1), Row(rhyme='容迟', count=1), Row(rhyme='耸峙', count=1), Row(rhyme='胧思', count=1), Row(rhyme='冬自', count=1), Row(rhyme='涌自', count=1), Row(rhyme='纵时', count=1), Row(rhyme='控试', count=1), Row(rhyme='种智', count=1), Row(rhyme='种私', count=1), Row(rhyme='勇自', count=1), Row(rhyme='中而', count=1), Row(rhyme='疯痴', count=1), Row(rhyme='种思', count=1), Row(rhyme='中视', count=1), Row(rhyme='空依', count=1), Row(rhyme='同治', count=1), Row(rhyme='逢知', count=1), Row(rhyme='痛已', count=1), Row(rhyme='公是', count=1), Row(rhyme='匆痴', count=1), Row(rhyme='总依', count=1), Row(rhyme='东市', count=1), Row(rhyme='重疑', count=1), Row(rhyme='钟只', count=1), Row(rhyme='忪似', count=1), Row(rhyme='梦慈', count=1), Row(rhyme='痛知', count=1), Row(rhyme='容痴', count=1), Row(rhyme='中撕', count=1), Row(rhyme='濛自', count=1), Row(rhyme='风事', count=1), Row(rhyme='共儿', count=1), Row(rhyme='松以', count=1), Row(rhyme='熊之', count=1), Row(rhyme='孔子', count=1)]\n",
      "CPU times: user 8.57 ms, sys: 2.66 ms, total: 11.2 ms\n",
      "Wall time: 429 ms\n"
     ]
    }
   ],
   "source": [
    "%time print(with_tone_cantonese(\"钟意\"))\n",
    "%time print(without_tone_cantonese(\"钟意\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "38d03463",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "'ong', 'ung', 'aa'\n",
      "{'rhyme': '广东话', 'count': 6},{'rhyme': '放松他', 'count': 6},{'rhyme': '当中那', 'count': 4},{'rhyme': '惶恐吧', 'count': 3},{'rhyme': '荡童话', 'count': 2},{'rhyme': '光融化', 'count': 2},{'rhyme': '光中也', 'count': 2},{'rhyme': '望中哑', 'count': 2},{'rhyme': '当童话', 'count': 2},{'rhyme': '广东那', 'count': 1},{'rhyme': '房中假', 'count': 1},{'rhyme': '当种下', 'count': 1},{'rhyme': '当中也', 'count': 1},{'rhyme': '放松怕', 'count': 1},{'rhyme': '放纵他', 'count': 1},{'rhyme': '放工打', 'count': 1},{'rhyme': '装终也', 'count': 1},{'rhyme': '糖冬瓜', 'count': 1},{'rhyme': '光红花', 'count': 1},{'rhyme': '谎童话', 'count': 1},{'rhyme': '挡风也', 'count': 1}\n",
      "CPU times: user 1.11 ms, sys: 2.47 ms, total: 3.58 ms\n",
      "Wall time: 2.88 ms\n"
     ]
    }
   ],
   "source": [
    "%time print(find_in_redis(\"广东话\", tone = False, cantonese = True))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
